//
//  RightCell.swift
//  ShiZhe
//
//  Created by 陈卿伟 on 16/9/7.
//  Copyright © 2016年 陈卿伟. All rights reserved.
//

import UIKit

class RightCell: UICollectionViewCell {
    var titleLabel:UILabel!
    override init(frame: CGRect) {
        titleLabel = UILabel()
        super.init(frame: frame)
        
        self.backgroundColor = BaseFunc.createCustomColor(138, b: 166, g: 216, a: 1)
        self.layer.cornerRadius = 6
        
        //创建titlelabel
        titleLabel.frame = CGRect(x: 10*SCALEW, y: 0, width: 62*SCALEW, height: 40*SCALEH)
        titleLabel.textAlignment = .Center
        titleLabel.numberOfLines = 0
        titleLabel.textColor = UIColor.whiteColor()
        titleLabel.font = BaseFunc.getLightFont(13.5)
        self.addSubview(titleLabel)
        
        let view = UIView(frame: CGRectMake(0,0,82*SCALEW,40*SCALEH))
        view.layer.cornerRadius = 6
        view.backgroundColor = Theme.BarGrayColor
        
        let imageView = UIImageView(frame: CGRectMake(60*SCALEW, 0, 22*SCALEW, 18*SCALEH))
        imageView.image = UIImage(named: "seleteItemIcon")
        view.addSubview(imageView)
        
        self.selectedBackgroundView = view
    }
    
    
    lazy var indicator:UIActivityIndicatorView = {
        let indicator = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.Gray)
        indicator.hidesWhenStopped = true
        indicator.frame = CGRectMake(40*SCALEW, 20*SCALEH, 0, 0)
        self.addSubview(indicator)
        return indicator
    }()
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
}
